<?php

//print_r($_POST);
 
// username and password sent from form 




if(!isset($_POST['from'])||!isset($_POST['to'])||!isset($_POST['message'])||!isset($_POST['time'])){
	header("location:../index.php?page=contact_user&stat=error");
}else{
	$from=$_POST['from'];
	$to=$_POST['to'];
	$message=$_POST['message'];
	$time=$_POST['time'];
}
$sql="
CALL `_s_message` (
'$from' , '$to' ,'$message' ,'$time'
)";




$qr = mysql_query( $sql ) or die( mysql_error() );

$result=array();
while( $qrow = mysql_fetch_assoc( $qr ) )
{

	array_push($result, $qrow);
}

  echo json_encode($result);


?>